package com.hzmall.controller.backend;

import com.hzmall.common.ServerResponse;
import com.hzmall.service.impl.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/manage/order/")
public class OrderBackendController {

    @Autowired
    private OrderService orderService;

    //订单列表
    @RequestMapping(value = "list.do")
    @ResponseBody
    public ServerResponse list(@RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize,@RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum){
        return this.orderService.backendList(pageSize, pageNum);
    }

    //按订单号搜索
    @RequestMapping(value = "search.do")
    @ResponseBody
    public ServerResponse search(Long orderNo){
        return this.orderService.backendSearch(orderNo);
    }

    //订单详情
    @RequestMapping(value = "detail.do")
    @ResponseBody
    public ServerResponse detail(Long orderNo){
        return this.orderService.backendSearch(orderNo);
    }

    //订单发货
    @RequestMapping(value = "send_goods.do")
    @ResponseBody
    public ServerResponse sendGood(Long orderNo){
        return this.orderService.sendGood(orderNo);
    }
}
